#pragma once
#include <Windows.h>
#include <d3d9.h>
#include<dsound.h>
#include "GameDefine.h"


class FWGame
{	
protected:
	int Width;
	int Height;
	char* Name;
	static HRESULT CALLBACK WinProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam);



public:
	ID_STATE id_scene;
	ID_STATE id_next_scene;
	HWND hwnd;
	HINSTANCE hInstance;
	LPDIRECT3D9 d3d;//doi tuong directx
	LPDIRECT3DDEVICE9 d3ddev;//thiet bi ve		

	FWGame(HINSTANCE hIns, char* windowName, int _Width,int _Height);
	FWGame(FWGame* fwgame);	
	~FWGame(void);

	bool initWindow();//cai dat cua so

	bool initDX();//cai dat moi truong directx	

	virtual void load();//load game data

	void run();// chay game

	virtual void update(float time);//cap nhat game

	virtual void render();// the hien game

	virtual void shutdown();//ket thuc game
};

